package com.chinasofti.singleton;

public class SecondSingleton {//懒汉模式
    private static SecondSingleton instance = null;

    //构造方法私有
    private SecondSingleton(){

    }
    //提供静态公共方法，返回自己创建的唯一实例
    public static SecondSingleton getInstance(){
        if (instance==null){
            instance = new SecondSingleton();
        }
        return instance;
    }
}
